package tree;

public class Tree {
    public static void main(String[] args) {
        //定义tree
        Node root = new Node((int)(Math.random()*10)+1);
        root.left = new Node((int)(Math.random()*10)+1);
        root.right = new Node((int)(Math.random()*10)+1);
        root.left.left = new Node((int)(Math.random()*10)+1);
        root.left.right = new Node((int)(Math.random()*10)+1);
        root.right.left = new Node((int)(Math.random()*10)+1);
        root.right.right = new Node((int)(Math.random()*10)+1);
    }

    static class Node {
        int value;
        Node left;
        Node right;
        Node(int value) {
            this.value = value;
        }
    }
}
